package com.sghd.football.robot.action;

import com.sghd.common.socket.client.Client;
import com.sghd.common.socket.core.Message;
import com.sghd.football.robot.core.Robot;
import com.sghd.football.utils.SocketEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * @author wch
 * @date 2018-07-06 17:06
 * @desc 进入房间
 **/
public class EnterAction extends AbstractAction {

    @Override
    public Stage stage() {
        return Stage.ENTER;
    }
    @Override
    public void action(Robot robot) {
        if (!check(robot)) {
            return;
        }
        Client client = robot.getClient();
        Map<String, Object> enter = new HashMap<>();
        enter.put("configId", 0);
        enter.put("gameId", 32);
        client.send(Message.valueOf(SocketEnum.JOIN_ROOM, enter));
    }
}
